package dx.util;

import redis.clients.jedis.Jedis;

/**
 * create by duanx 2021/6/12
 *@description： todo
 *@classname: Redis
 *@author: duanx
 *@date: 2021/6/12 0:32
 **/
public class Redis {

    public static void test(){
        Jedis jedis = new Jedis("localhost",6379);
        jedis.auth("888888");
        int i = 0;
        long start = System.currentTimeMillis();
        try {
            while (true){
                long end  = System.currentTimeMillis();
                if (end-start>1000){
                    break;
                }
                i++;
                jedis.del("test"+i);
            }
        }finally {
            jedis.close();
        }
        System.out.println("操作了"+i+"次");
    }





    public static void main(String[] args) {
        test();
    }

}
